
import { getToken, setToken, removeToken } from '@/utils/auth'
import { resetRouter } from '@/router'
import  {_API} from '@/api/bai'

const types = {
  
}
const state = {
      
      
        zy_statistics_list:{
          list:[]
        },
        mz_statistics_list:{
          list:[]
        },
      
}

const mutations = {
    set_zy_statistics_list(state,param){
    state.zy_statistics_list=param;
 },
 set_mz_statistics_list(state,param){
  state.mz_statistics_list=param;
},

  
}

const actions = {


    getClinic_drug_houseOutStatisticList({ commit }, d){
    return new Promise((resolve, reject) => {
      _API.getClinic_drug_houseOutStatistic(d).then((res)=>{
         
            if (res.code === 200 && res.data) {
            
              commit('set_mz_statistics_list',res.data)
          
              resolve(res)
           
          } else {
              commit('set_mz_statistics_list', {})
              resolve()
          }
      })
    })
  },
  geth_pharmacyoutStatisticList({ commit }, d){
    return new Promise((resolve, reject) => {
      _API.geth_pharmacyoutStatistic(d).then((res)=>{
         
            if (res.code === 200 && res.data) {
            
              commit('set_zy_statistics_list',res.data)
          
              resolve(res)
           
          } else {
              commit('set_zy_statistics_list', {})
              resolve()
          }
      })
    })
  },
  
  
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

